<%@ taglib uri="http://struts.apache.org/tags-bean" prefix="bean" %>
<%@ taglib uri="http://struts.apache.org/tags-html" prefix="html" %>
<%@ taglib uri="http://struts.apache.org/tags-logic" prefix="logic" %>
<%@page contentType="text/html" pageEncoding="UTF-8"%>

<% request.setAttribute("allowed", "Gestionar Sedes, Areas y Edificios");%>
<%@ include file='../Templates/security.jsp' %>

<%
            int planta = Integer.parseInt((String) request.getParameter("planta"));
%>

<td <% out.print("id=\"td_"+planta+"\"");  %>>
    <html:form action="/AgregarPisoEdificio" enctype="multipart/form-data" method="POST"
               styleClass="pisosEdificioForm" target="returnMsg">
        <html:hidden property="sede" styleClass="sedeParam"/>
        <html:hidden property="edificio" styleClass="edificioParam"/>
        <html:hidden property="piso" styleId="pisoParam"/>
        <iframe id="returnMsg" name="returnMsg" src="#"></iframe>
        <table>
            <tr>
                <td><% out.print("Planta " + planta + "     ");%></td>
                <td>
                    <select>
                        <%
                                    if (planta == 1) {

                                        out.print("<option value=\"" + planta + "\" id=\"ss\">Sotano</option>");
                                        out.print("<option value=\"" + planta + "\" id=\"pb\" selected=\"true\">Planta Baja</option>");
                                    } else {
                                        out.print("<option value=\"" + planta + "\" id=\"pb\">Planta Baja</option>");
                                        out.print("<option value=\"" + planta + "\" id=\"ps\" selected=\"true\">Piso</option>");

                                    }
                        %>
                    </select>
                </td>
                <td>
                    <html:file property="formFile" styleClass="piso"/>
                </td>
                <td>
                    <font color="red">
                        <bean:write name="AgregarPisoEdificioForm" property="error" />
                        &nbsp;
                    </font>
                </td>
            </tr>
        </table>
        
    </html:form>
</td>
<script type="text/javascript">
    $(function(){
       <% out.print("$(\"#td_"+planta+" #pisoParam\").val("+planta+");");  %>
    });
</script>
